<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>echarts</title>
  <style>
    .chart1,
    .chart2 {
      width: 800px;
      height: 400px;
    }
  </style>
</head>

<body>
  <div class="chart1"></div>
  <div class="chart2"></div>
  <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.3.0/echarts.min.js"></script>

  <script>
    const myEcharts1 = echarts.init(document.querySelector('.chart1'))
    const myEcharts2 = echarts.init(document.querySelector('.chart2'))

    const option1 = {
      title: {
        text: '图表一'
      },
      xAxis: {
        // type: 'category',
        data: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'],
        axisTick: {
          alignWithLabel: true
        },
        boundaryGap: false, // 不要左右的空隙
      },
      yAxis: {},
      series: {
        type: 'line',
        data: [
          800, 700, 900, 888, 999, 1200, 1100
        ],
        areaStyle: { // 区域样式
          color: 'pink'
        },
        lineStyle: { // 线样式
          color: 'pink'
        },
        itemStyle: { // 拐点样式
          color: 'pink'
        },
      }
    }
    const option2 = {
      title: {
        text: '图表二'
      },
      xAxis: {
        data: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
      },
      yAxis: {},
      series: {
        type: 'bar',
        data: [
          800, 700, 900, 888, 999, 1200, 1100
        ]
      }
    }

    myEcharts1.setOption(option1)
    myEcharts2.setOption(option2)

  </script>
</body>

</html>